#ifndef BASEMODBUSCMD_H
#define BASEMODBUSCMD_H

#include <QObject>
#include "Command/BaseCmd.h"
#include "DataType/ModbusControlStruct.h"

class BaseModbusCmd : public BaseCmd
{
    Q_OBJECT
public:
    explicit BaseModbusCmd(QObject *parent = 0):BaseCmd(parent)
    {
        m_isResend = true;
        m_reSendCount = 1;
        m_timeoutCount = 5000;
        m_currentTimeoutCount = 0;
    }
    virtual ~BaseModbusCmd(){}

    virtual Package toPackage() = 0;
    virtual void unPackage(Package package) = 0;


    ModbusControlStruct modbusControl() const
    {
        return m_modbusControl;
    }

    void setModbusControl(const ModbusControlStruct &modbusControl)
    {
        m_modbusControl = modbusControl;
    }

protected:
    ModbusControlStruct m_modbusControl;

};

#endif // BASEMODBUSCMD_H
